/**
 * DredgeUser 业务逻辑实现类
 * @author yanwl
 * @date 2014-09-16
 */
package com.chnbst.bstyun.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.chnbst.bstyun.core.base.BaseService;
import com.chnbst.bstyun.core.common.helper.DaoHelper;
import com.chnbst.bstyun.model.pojo.DredgeUser;
import com.chnbst.bstyun.service.DredgeUserService;

@Transactional
@Service
public class DredgeUserServiceImpl extends BaseService implements DredgeUserService {
	
	//声明日志对象 logback
	private final static Logger logger = LoggerFactory.getLogger(DredgeUserServiceImpl.class);
	private final static String nameSpace = "com.chnbst.bstyun.mapper.DredgeUserMapper";
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean deleteDredgeUser(Integer dredgeUserId) {
		return DaoHelper.delete(nameSpace, "deleteDredgeUser", dredgeUserId);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean insertDredgeUser(DredgeUser dredgeUser) {
		return DaoHelper.insert(nameSpace, "insertDredgeUser", dredgeUser);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean updateDredgeUser(DredgeUser dredgeUser) {
		return DaoHelper.update(nameSpace, "updateDredgeUser", dredgeUser);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public DredgeUser selectDredgeUserByDredgeUserId(Integer dredgeUserId) {
		return (DredgeUser)DaoHelper.query(nameSpace, "selectDredgeUserByDredgeUserId", dredgeUserId);
	}
	
	@SuppressWarnings("unchecked")
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public List<DredgeUser> selectDredgeUsers() {
		return (List<DredgeUser>)DaoHelper.list(nameSpace, "selectDredgeUsers", null);
	}
}
